﻿<%@ WebHandler Language="C#" Class="createUser" %>

using System;
using System.Web;

using AMCBO;
using AMCOBJ;

public class createUser : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        //context.Response.ContentType = "text/plain";
        //context.Response.Write("Hello World");
        users obj_user = new users();
        createusers obj_create = new createusers();
        int x;
        if(!string.IsNullOrEmpty(context.Request.QueryString["uEmail"].ToString()))
        {
            obj_user.UserEmail = context.Request.QueryString["uEmail"].ToString();
        }
        if (!string.IsNullOrEmpty(context.Request.QueryString["uPassword"].ToString()))
        {
            obj_user.UserPassword = context.Request.QueryString["uPassword"].ToString();
        }
        if (!string.IsNullOrEmpty(context.Request.QueryString["uName"].ToString()))
        {
            obj_user.UserName = context.Request.QueryString["uName"].ToString();
        }
        if (!string.IsNullOrEmpty(context.Request.QueryString["uPhone"].ToString()))
        {
            obj_user.UserPhone = context.Request.QueryString["uPhone"].ToString();
        }

        try
        {
            x = obj_create.create_User(obj_user);
            if (x == 0)
            {
                context.Response.Write("y");
            }
            else
            {
                context.Response.Write("n");
            }
        }
        catch (Exception ex)
        {
            context.Response.Write(ex);
        }
        
    }
    public bool IsReusable {
        get {
            return false;
        }
    }

}